package mrusanov.util

import javax.swing.JPanel
import java.awt.{Graphics, Dimension, Image}

class ImagePanel(image:Image) extends JPanel {
  private val _size = new Dimension(image.getWidth(null), image.getHeight(null))
  setSize(_size)
  setPreferredSize(_size)
  setMinimumSize(_size)
  setMaximumSize(_size)
  setLayout(null)

  override def paintComponent(g:Graphics) {
    g.drawImage(image, 0, 0, null)
  }
}
